<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller{
    public function __construct()
    {
        parent::__construct();
        $this->check_login();
    }
    public function check_login(){
        if (!isset($_SESSION['user'])){
            $this->error('你还没有登录',U('User/login'));
        }
        $this->assign('user',$_SESSION['user']);
    }
}